#define min(a,b) (((a) < (b)) ? (a) : (b))
/************************************************************************/
/*  Global Struct Define Section
/************************************************************************/

enum {
    MD4_BLOCK_SIZE = 64,
    MD4_DIGEST_SIZE = 16,
    MD4_PAD_SIZE = 56
};

typedef struct Md4 {
    unsigned int  buffLen;   /* in bytes          */
    unsigned int  loLen;     /* length in bytes   */
    unsigned int  hiLen;     /* length in bytes   */
    unsigned int  digest[MD4_DIGEST_SIZE / sizeof(unsigned int)];
    unsigned int  buffer[MD4_BLOCK_SIZE / sizeof(unsigned int)];
} Md4;

void initMd4(Md4* md4);
void md4Update(Md4* md4, const unsigned char* data, unsigned int len);
void md4Final(Md4* md4, unsigned char* hash);